package com.ibeifeng.thread;

public class TestThread04 {
	public static void main(String[] args) {
		new TestThread04().begin();
	}
	
	private void begin(){
		MyThread mt = new MyThread();
		Thread t1 = new Thread(mt,"wu");
		t1.start();
		Thread t2 = new Thread(mt,"miao");
		t2.start();
	}
	
	class MyThread implements Runnable{
		private int index = 0;

		@Override
		public void run() {
			for(;index<10;index++){
				System.out.println(Thread.currentThread().getName()+":"+index);
			}
		}
		
	}
}
